﻿using System.Web.Mvc;
using WebMVC.Helpers;

namespace WebMVC.Areas.AdminPanel
{
    public class AdminPanelAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "AdminPanel";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
           context.MapRoute(
                "AdminProductDefault",
                "AdminPanel/Product/{action}/{type}/{id}",
                new { controller = "Product", action = "Index", type = "BCARD", id = UrlParameter.Optional },new string[]{"WebMVC.Areas.AdminPanel.Controllers"},
                
                new string[] { "WebMVC.Areas.AdminPanel.Controllers" }
            ).RouteHandler = new SingleLingualMvcRouteHandler(); 

            context.MapRoute(
                "AdminPanel_default",
                "AdminPanel/{controller}/{action}/{id}",
                new { controller = "Dashboard", action = "Index", id = UrlParameter.Optional },
                new string[] { "WebMVC.Areas.AdminPanel.Controllers" }
            ).RouteHandler = new SingleLingualMvcRouteHandler();
        }
    }
}

